home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / gui / uberwidgets / skinnedpanel.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  2KB  |  46 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. import wx
  5. from wx import BufferedPaintDC, RectS
  6. from gui.uberwidgets.uberwidget import UberWidget
  7. from gui.uberwidgets.UberButton import UberButton
  8. from util import Delegate
  9.  
  10. class SkinnedPanel(wx.Panel, UberWidget):
  11.     
  12.     def __init__(self, parent, key):
  13.         wx.Panel.__init__(self, parent, style = wx.TAB_TRAVERSAL | wx.FULL_REPAINT_ON_RESIZE)
  14.         self.SetSkinKey(key, True)
  15.         Bind = self.Bind
  16.         Bind(wx.EVT_ERASE_BACKGROUND, (lambda e: pass))
  17.         Bind(wx.EVT_PAINT, self.OnPaint)
  18.         self.ChildPaints = Delegate()
  19.  
  20.     
  21.     def UpdateSkin(self):
  22.         skin = skin
  23.         import gui
  24.         skinkey = self.skinkey
  25.         native = self.native = not skinkey
  26.         if not native:
  27.             self.bg = skin.get(skinkey + '.background')
  28.             self.itemskin = skin.get(skinkey + '.itemskin')
  29.             for child in self.Children:
  30.                 if isinstance(child, UberButton):
  31.                     child.SetSkinKey(self.itemskin)
  32.                     continue
  33.             
  34.         
  35.         self.Refresh(False)
  36.  
  37.     
  38.     def OnPaint(self, e):
  39.         dc = BufferedPaintDC(self)
  40.         if self.bg:
  41.             self.bg.Draw(dc, RectS(self.ClientSize))
  42.         
  43.         self.ChildPaints(dc)
  44.  
  45.  
  46.